home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.object,comp.lang.eiffel,comp.lang.c++,comp.lang.beta,comp.lang.java,comp.lang.sather
- Path: newsfeed.acns.nwu.edu!ftpbox!mothost!schbbs!news
- From: shang@corp.mot.com (David L. Shang)
- Subject: Re: What Should An Exception Handling Do? -- Clarification of rules
- Reply-To: shang@corp.mot.com
- Organization: MOTOROLA
- Date: Fri, 29 Mar 1996 15:23:21 GMT
- Message-ID: <1996Mar29.152321.25943@schbbs.mot.com>
- References: <4jefbd$k33@kai.com>
- Sender: news@schbbs.mot.com (SCHBBS News Account)
- Nntp-Posting-Host: 129.188.128.126
-
- In article <4jefbd$k33@kai.com> robison@kai.com (Arch Robison) writes:
- > In article <1996Mar27.211117.5569@schbbs.mot.com> shang@corp.mot.com writes:
- > >If resumption semantics were inferior, why should we bother to get
- > >its "benefits" by simulating its semantics as below:
- >
- > I should have qualified my statement "inferior" to "inferior in most cases".
- >
-
- When you say inferior, please be specific, otherwise you cannot
- convince people.
-
- > >What happen if we forget to inialize "retry"? Okay, we can use break, but
- > >what happen if we have nested exceptions? "Goto" must be used, I guess.
- > >Busy jumps around are no fun.
- > >
- > >What happen if we forget to set "result" to NULL under condition4?
- >
- > What if I forget to increment my loop variables? What if I use single
- > precision where I should have used double precision? What if I misunderstood
- > the problem specification? What if my disk drive explodes today?
-
- A language cannot guarantee that every body using it do not
- say someting wrong. But a good programming language should
- help programmers make less errors.
-
- Basic principles exsist. For example, a function that has
- an output should guarantee that the code writer returns
- an value in the correct type. The questions I asked belongs to
- basic principles. Your disk drive explosion has nothing do to with
- the principle of language design.
-
- > There is no such thing as a feature
- > that "you do not pay for it if you do not use it."
-
- If language makes you to have the above conclusion, the design of the
- language is questionale. Futunately, C++ is not the language. And in
- contrast, "you do not pay for it if you do not use it" is the
- design principle of C++.
-
- > Thus many apparently useful features are deliberately left out of C++.
- > Users who want the features can simulate them without burdening others.
- > Besides, for some of these features, even the users who want them
- > disagree about the precise semantics, so it is often better to let
- > the users simulate the feature so that they can define the semantics
- > they want.
-
- So why should we have inheritance? virtual functions? We can use
- C function pointers to simulate them! Simlation is always possible, even
- with machine languages.
-
- Finally, my original post is a question, to ask what should an
- exception handling do. No one is attacking C++. People can always
- express their different opinions. Please do not overact. We are
- not talking a particular language here.
-
- David Shang
-
-